<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>立即购买</title>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/semantic.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/common.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/main.css">
    <script src="__PUBLIC__/Js/flickity-docs.min.js"></script>
</head>
<style>
    body{
        background-color: #fff;
    }
    .or-box1 {
        border-top:1px solid  #c9cbcb;
        overflow:hidden;
        padding:0px 5px;
        position: fixed;
        bottom: 60px;
        z-index: 2;
        background-color: #fff;
    }
    .or-box1 div{
       
        float: right;
    }
    .sbox1{
        width: 45%;
    }
    .gouwu{
        width: 55%;
        margin-top: 11px;
    }
    .dizhi{
        border-bottom:15px solid transparent;
         -moz-border-image:url(__PUBLIC__/Images/index/line.png) 18 6 round; /* Old Firefox */
        -webkit-border-image:url(__PUBLIC__/Images/index/line.png) 18 6 round;    /* Safari and Chrome */
        -o-border-image:url(__PUBLIC__/Images/index/line.png) 18 6 round;     /* Opera */
        border-image:url(__PUBLIC__/Images/index/line.png) 18 6 round;
        padding: 20px 5px;
        overflow:hidden;
    }
    .dizhi-xx{
        width: 80%;
        float: left;
    }
    .xiangq{
        width: 70%;
        float: left;
    }
    .xiangq img{
        float: left;
        margin-right: 5%;
    }
   .cart_one{
        border-bottom: 5px solid #f2f2f2;
    }
    .qedd-sl{
        padding:10px 5px; 
        color: #000;
        overflow:hidden;
         border-bottom: 5px solid #f2f2f2;
    }
    .qedd-sl .Spinner{
        width: 50%;
        float: right;
        margin-top: 5px;
    }
    .qedd-sl .peisong{
        width: 50%;
        float: right;
        margin-top: 5px;
        text-align: center; 
        position: relative; 
    }
    .qedd-sl .peisong select{
        border: none;
         position: absolute;  
        left: 0px;  
        top: 0px;  
        width: 100%;  
        height: 3em;  
    }
    @media (max-width: 375px){
        .sbox1{
        width: 39%;
    }
    .gouwu{
        width: 61%;
        margin-top: 10px;
    }
}
@media (max-width: 320px){
     .sbox1{
        width: 42%;
    }
    .gouwu{
        width: 58%;
        margin-top: 10px;
    }
    .gw,.gm{
        padding: 10px !important;
    }
}

</style>
<body>
<div class="accounttitle"><h1>立即购买 </h1></div>
<form name="form3" method="post" action="__URL__/delBuyList_all">
    <div class="pusher">
    <!-- 地址 -->
    <a href="" style="display: block;">
        <div class="dizhi">
            <img src="__PUBLIC__/Images/index/dingwei.png" alt="" style="float: left;margin-top: 10px;margin-right: 5px;">
            <div class="dizhi-xx">
                <p style="color: #363636">收货人:测试<span style="display:block;float: right;text-align: right;">18367434209</span></p>
                <p style="color: #000">收货地址:广西南宁市</p>
            </div>
            <img src="__PUBLIC__/Images/index/right.png" alt="" style="float: right;margin-top: 10px;" alt="">
        </div>
    </a>
    <!-- 图片 -->
      <div class="vlist" style="padding: 0;"> 
            <ul>
            <li class="cart_one">
                <div class="check-box">
                    <input type="checkbox" name="oid[]" value="{$info[$vo['id']]['order_id']}" id="oid[]" checked="checked">
                </div>
                <div class="xiangq"> 
                <img class="list_img" src="__PUBLIC__/Images/index/loginbg.png" width="85" height="85">
                    <div class="list_info">
                        <div class="tit c666">
                            商品名称： {$info[$vo['id']]['name']}
                        </div>
                        <div class="tit price" style="color: #b23b32">
                            商品单价：￥
                            <span> {$info[$vo['id']]['money']}</span>
                        </div>
                        <div class="tit">购买数量：<span>{$info[$vo['id']]['num']}</span></div>
                        <div class="cls"></div>
                    </div>
                </div>
               <div style="clear: both;"></div>
            </li>
             <div style="clear: both;"></div>
            </ul>
        </div>
        <!-- 数量 -->
        <div class="qedd-sl">
            <span style="float: left;margin-top: 10px">购买数量</span>
            <div class="Spinner">
                <input type="button" value="-" class="jian" />
                <span class="shuliang">0</span>
                <input type="button" value="+" class="jia" />
            </div>
        </div>
         <!-- 配送方式 -->
        <div class="qedd-sl">
            <span style="float: left;margin-top: 10px">配送方式</span>
            <div class="peisong">
                <select name="" id="">
                    <option value="">快递</option>
                </select>
            </div>
        </div>

        <div class="or-box or-box1">
            <div class="gouwu">
              <div class="zongji" style="float: left;margin-top: 0px;color: #000">合计：<span style="color: #b23b32">&nbsp;{$prs.money}</span></div>
                <input type="submit" name="action" value="结算" class="ui orange button gm" style="float: left;background:#b13a33;padding: 10px;float: right; ">
            &nbsp;&nbsp;
               
                <input name="pid" type="hidden" class="ipt"  id="UserCode" value="{$rs.id}"/>
                <input name="id" type="hidden" class="ipt"  id="id" value="{$prs.id}"/>
                <input name="cptype" type="hidden" class="ipt"  id="cptype" value="{$prs.cptype}"/>
                <input name="nums" type="hidden" class="ipt"  id="nums" value=""/>
            </div>
            
        </div>
    </div>
</form>

<script>
    var oUl=document.getElementsByTagName('ul')[0];
    var aLi=oUl.getElementsByTagName('li');
    var aEm=document.getElementsByTagName('em');
    var goodsnum=document.getElementById("nums");
    console.log(goodsnum);
    var oStrong=document.getElementsByTagName('strong')[0];
    var total=0;
    var countprice=0;
    var max=0;
    for (var i = 0; i < aLi.length; i++) {
        shop(aLi[i]);
        shop2(aLi[i]);
    };

        function shop2(obj){
        var aInp=obj.getElementsByTagName('input');
        var aSpan=obj.getElementsByTagName('span');
        var num=parseInt(aSpan[0].innerHTML);
        var price=parseFloat(aSpan[2].innerHTML);
            aSpan[0].innerHTML=num;
            goodsnum.value=num;
            aSpan[3].innerHTML=num*price+'元';
            total--;
            countprice-=price;
            aEm[0].innerHTML=total;
            oStrong.innerHTML=countprice;
            setmax();
        }

    function shop(obj){
        var aInp=obj.getElementsByTagName('input');
        var aSpan=obj.getElementsByTagName('span');
        var num=parseInt(aSpan[0].innerHTML);
        var price=parseFloat(aSpan[2].innerHTML);
        aInp[0].onclick=function(){
            if(num<=0)return;
            num--;
            aSpan[0].innerHTML=num;
            goodsnum.value=num;
            aSpan[3].innerHTML=num*price+'元';
            total--;
            countprice-=price;
            aEm[0].innerHTML=total;
            oStrong.innerHTML=countprice;
            setmax();


        }
        aInp[1].onclick=function(){
            num++;
            aSpan[0].innerHTML=num;
            goodsnum.value=num;
            aSpan[3].innerHTML=num*price+'元';
            total++;
            countprice+=price;
            aEm[0].innerHTML=total;
            oStrong.innerHTML=countprice;
            setmax();
        }

    }
    function setmax(){
        max=0;
        for (var i = 0; i < aLi.length; i++) {
            var aSpan=aLi[i].getElementsByTagName('span');
            if(aSpan[0].innerHTML>0){
                if(max<parseFloat(aSpan[2].innerHTML)){
                    max=parseFloat(aSpan[2].innerHTML);
                }
            }
            aEm[1].innerHTML=max;
        }



    }
</script>
<div style="height:70px;background-color:#fff;"></div>
<include file="Public:footer" />